package com.chenfan.magic.constant;

import com.chenfan.magic.base.R;
import com.chenfan.magic.utils.DateUtil;
import com.chenfan.magic.utils.IDKit;
import com.google.common.collect.Maps;

import java.util.Date;
import java.util.Map;

/**
 * 常量参数集
 *
 * @author 周夕
 * @date 2020-02-26 17:18
 */
public class ParamConstant {

    public static R get() {
        Date date = new Date();
        Map<String, Object> constantMap = Maps.newHashMap();
        constantMap.put("snowflakeId", (IDKit.snowFlake() + ""));
        constantMap.put("datetime", DateUtil.DATETIME_FORMAT.format(date));
        constantMap.put("date", DateUtil.DATE_FORMAT.format(date));
        constantMap.put("time", DateUtil.TIME_FORMAT.format(date));
        constantMap.put("timestamp", System.currentTimeMillis());
        return R.success().put(constantMap);
    }
}
